home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Include_Files / SDBITMAP.RUL < prev    next >
Encoding:
Text File  |  1997-11-20  |  4.6 KB  |  120 lines

  1.  
  2.  /*=======================================================================*/
  3.  /*                                                                       */
  4.  /*           (c) InstallShield Software Corporation (1996-1997)          */
  5.  /*            (c)  InstallShield Corporation  (1990-1996)                */
  6.  /*                       Schaumburg, Illinois 60173                      */
  7.  /*                          All Rights Reserved                          */
  8.  /*                           InstallShield (R)                           */
  9.  /*                                                                       */
  10.  /*   File    : sdbitmap.rul                                              */
  11.  /*                                                                       */
  12.  /*   Purpose : This file contains the code for the SdBitmap              */
  13.  /*             script dialog function.                                   */
  14.  /*                                                                       */
  15.  /*=======================================================================*/
  16.  
  17.  /*------------------------------------------------------------------------*/
  18.  /*                                                                        */
  19.  /*   Function: SdBitmap                                                   */
  20.  /*                                                                        */
  21.  /*   Descrip:  This dialog will let user display a bitmap along with      */
  22.  /*             a message.  The message can be hidden by the resource      */
  23.  /*             editor if only the bitmap is desired.                      */
  24.  /*   Misc:                                                                */
  25.  /*                                                                        */
  26.  /*------------------------------------------------------------------------*/
  27. function SdBitmap( szTitle, szMsg, szBitmap )
  28.           STRING  szDlg, szTemp, szImage;
  29.           STRING  svItem[ MAX_STRING ];
  30.           NUMBER  nId, nTemp;
  31.           NUMBER  nReturn, nMessage;
  32.           HWND    hwndDlg;
  33.           BOOL    bDone, bChange;
  34.         begin
  35.  
  36.            szDlg     = SD_DLG_BITMAP;
  37.            nSdDialog = SD_NDLG_BITMAP;
  38.  
  39.            // record data produced by this dialog
  40.            if (MODE=SILENTMODE) then
  41.              SdMakeName( szAppKey, szDlg, szTitle, nSdBitmap );
  42.              SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  43.              return nId;
  44.            endif;
  45.  
  46.            // ensure general initialization is complete
  47.            if (!bSdInit) then
  48.               SdInit();
  49.            endif;
  50.  
  51.            if (EzDefineDialog( szDlg, "", "", SD_NDLG_BITMAP ) = DLG_ERR) then
  52.               return -1;
  53.            endif;
  54.  
  55.            // set temporary image (save current image)
  56.            DialogSetInfo( DLG_INFO_ALTIMAGE, szBitmap, 1 );
  57.  
  58.            // Loop in dialog until the user selects a standard button
  59.            bDone = FALSE;
  60.  
  61.            while (!bDone)
  62.  
  63.               nId = WaitOnDialog( szDlg );
  64.  
  65.               switch (nId)
  66.               case DLG_INIT:
  67.  
  68.                    if( szMsg != "" ) then
  69.                        SdSetStatic( szDlg, SD_COMPONENT_MSG, szMsg );
  70.                    endif;
  71.  
  72.                    hwndDlg = CmdGetHwndDlg( szDlg );
  73.                    SdGeneralInit( szDlg, hwndDlg, STYLE_NORMAL, szSdProduct );
  74.  
  75.                    if(szTitle != "") then
  76.                        SetWindowText(hwndDlg, szTitle);
  77.                    endif;
  78.  
  79.                    // restore old image
  80.                    DialogSetInfo( DLG_INFO_ALTIMAGE, "", -1 );
  81.  
  82.               case SD_PBUT_OK:
  83.                    nId   = OK;
  84.                    bDone = TRUE;
  85.  
  86.               case BACK:
  87.                    nId    = BACK;
  88.                    bDone  = TRUE;
  89.  
  90.               case DLG_ERR:
  91.                    SdError( -1, "SdBitmap" );
  92.                    nId   = -1;
  93.                    bDone = TRUE;
  94.  
  95.               case DLG_CLOSE:
  96.                    SdCloseDlg( hwndDlg, nId, bDone );
  97.  
  98.               default:
  99.                    // check standard handling
  100.                    if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  101.                        bDone = TRUE;
  102.                    endif;
  103.               endswitch;
  104.  
  105.            endwhile;
  106.  
  107.            EndDialog( szDlg );
  108.            ReleaseDialog( szDlg );
  109.  
  110.            SdUnInit();
  111.  
  112.            // record data produced by this dialog
  113.            SdMakeName( szAppKey, szDlg, szTitle, nSdBitmap );
  114.            SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  115.  
  116.            return nId;
  117.  
  118.         end;
  119.  
  120.